// collider.h
#ifndef COLLIDER_H
#define COLLIDER_H

#include "../core/node_affiliate.h"
enum class Type{
        CIRCLE,         // size_ 的 x 轴为直径, 默认 y=x;
        RECTANGLE
    };
    
class collider : public node_affiliate
{
protected:
    Type type_ = Type::CIRCLE;
public:
    virtual void render() override;
    
    static collider* createCollider(screen* parent, glm::vec2 size, 
        Type type = Type::CIRCLE,const char* name = "collider",Anchor anchro = Anchor::ANCHOR_CENTER);
    bool isColliding(collider* other);

    // getters and setters
    Type type() const { return type_; }
    void setType(Type type) { type_ = type; }
};

#endif // COLLIDER_H